<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>空调设备状态</title>
<%@ include file="/common/util.jsp"%>
<!-- <script src="${cdnctx}/dep/jquery/modernizr.js"></script> -->
<!-- <script src="${cdnctx}/dep/jquery/spin.js"></script> -->
<!-- <script type="text/javascript" src="${cdnctx }/src/collectdata/collectDataDetail.js"></script> -->
<script type="text/javascript">
	$(function() {
		    var minute_order = 'useminute,gatewayid,SensorID,ChannelID';
			var default_order = 'gatewayid,SensorID,ChannelID';
			var sidx = '${sidx}';
			var myhref = $('#new_order').attr('href');
			if(sidx == minute_order) {
				$('#new_order').attr('href', myhref + '&sidx=' + default_order);
			}else {
				$('#new_order').attr('href', myhref + '&sidx=' + minute_order);
			}
	})
	
    function jumpPage(pageIndex){   
        window.location.href="${cdnctx}/economicBenefit/airdevicestatus.shtml?"+$.param($("#airdevicestatusForm" +
						"").serializeObject())+"&pageIndex="+pageIndex+"&companycode=${companycode }";
    }
	function sub() {
		var sensorid = $("#sensorid").val();
		if (!isNaN(sensorid)&& sensorid.length < 5) {
			console.log("表单提交")
			$("#airdevicestatusForm").submit();
		}
	}
</script>
</head>
<body class="main">
	<div class="-frame -style -luster" id="css_container">
		<!--首页框架页眉部分↓-->
		<%@ include file="/WEB-INF/pages/inc/header.jsp"%>
		<!--首页框架页眉部分↑-->

		<div class="content">

			<!-- Left导航菜单◎开始 -->
			<%@ include file="/WEB-INF/pages/inc/leftmenu.jsp"%>
			<!-- Left导航菜单◎结束 -->
			<div class="main-mid">
				<div class="pos">
					<img src="${cdnctx}/src/index/img/index.png" />
					<a
							href="${cdnctx}/system/customerinfo/customerList.shtml">客户管理 </a>>
					<a href="JavaScript:void(0);">${customername}_设备状态</a> 
					<span style="float: right; margin-right: 25px;">
						<a href="${cdnctx}/economicBenefit/AirEconomicBenefitFth.shtml?companycode=${companycode }">数据采集</a>
					</span>
				</div>
				<div class="css_contentDiv">
					<form id="airdevicestatusForm
					" action="${cdnctx}/economicBenefit/airdevicestatus.shtml" method="post">
						<div style="padding: 10px;">
							<input type="hidden" name="companycode" value="${companycode }" />
							<input type="hidden" name="sidx" value="${sidx }" /> 
							<label class="search_text">物联网关:</label> 
							<input type="text" class="search_input" id="gatewayid" name="gatewayid" value="${collectArea.gatewayid}"/> 
							<label class="search_text">采集设备节点:</label> 
							<input type="text" class="search_input" id="sensorid" name="sensorid" value="${collectArea.sensorid}"/> 
							<input type="button" onclick="sub()" class="search_btn" value="查&nbsp;询" />
							<input type="reset" class="reset_btn" value="重&nbsp;置" />
						</div>
					</form>
					<div class="divTable">
						<div class="detailDiv" style="background-color:white">
							<table class="list_table">
								<thead>
									<tr>
										<td>物联网关</td>
										<td>采集设备（节点）</td>
										<td>采集区域（通道）</td>
										<td><u> <a id="new_order" href="${cdnctx}/economicBenefit/airdevicestatus.shtml?gatewayid=${collectArea.gatewayid}&sensorid=${collectArea.sensorid}&companycode=${companycode }">工作状态</a></u></td>
									</tr>
								</thead>
								<c:if test="${empty(collectAreasairs) }">
									<tr class="even" style="color: red">
										<td colspan="10" class="no-data" style="height: 300px;"></td>
									</tr>
								</c:if>
								<c:if test="${not empty(collectAreasairs) }">
									<c:forEach items="${collectAreasairs}" var="entity" varStatus="status">
										<tr <c:if test="${entity.useminute == 0 }">style="background: #F3F6FB"</c:if>>
											<td><u> <a href="JavaScript:void(0);">${entity.gatewayid}</a></u></td>
											<td>${entity.sensorid}</td>
											<td><u> <a href="JavaScript:void(0);">${entity.channelid}</a></u></td>
											<td <c:if test="${entity.useminute == 0 }">style="color: red;"</c:if> >
											<c:if test="${entity.useminute == 0 }">未工作</c:if>
											</td>
										</tr>
									</c:forEach>
								</c:if>
							</table>
						</div>
						<c:if test="${not empty(collectAreasairs) }">
							<div id="pageInfo" class="pageJump">
								<script type="text/javascript">
                                        pagination.getPaginationHtml('JavaScript:jumpPage({0})',${pageIndex},${pageCount},'pageInfo');
                                    </script>
								共有${dataCount}条数据
							</div>
						</c:if>
					</div>
				</div>
			</div>
		</div>
		<!--首页框架页尾部分↓-->
		<%@ include file="/WEB-INF/pages/inc/footer.jsp"%>
		<!--首页框架页尾部分↑-->
	</div>
</body>
</html>
